﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace Projekt_GUI.Forms
{
    public partial class DBConfig : Form
    {
        public DBConfig()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            File.WriteAllText("db.config", "HOST="+textBox1.Text+"\nUSER="+textBox2.Text+"\nPASS="+textBox3.Text);
            Form1.CONFIG_DB_HOST = textBox1.Text;
            Form1.CONFIG_DB_USER = textBox2.Text;
            Form1.CONFIG_DB_PASS = textBox3.Text;
            Close();
        }

        private void DBConfig_Load(object sender, EventArgs e)
        {
            textBox1.Text = Form1.CONFIG_DB_HOST;
            textBox2.Text = Form1.CONFIG_DB_USER;
            textBox3.Text = Form1.CONFIG_DB_PASS;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
